package cc.fs.zhihuapp.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created by fostion on 2015/8/24.
 */
public class Category implements Parcelable {

    String limit;
    ArrayList<String> subscribed;
    ArrayList<Theme> others;

    public String getLimit() {
        return limit;
    }

    public void setLimit(String limit) {
        this.limit = limit;
    }

    public ArrayList<String> getSubscribed() {
        return subscribed;
    }

    public void setSubscribed(ArrayList<String> subscribed) {
        this.subscribed = subscribed;
    }

    public ArrayList<Theme> getOthers() {
        return others;
    }

    public void setOthers(ArrayList<Theme> others) {
        this.others = others;
    }

    @Override
        public String toString() {
            return "Category{" +
                "limit='" + limit + '\'' +
                ", subscribed=" + subscribed +
                ", others=" + others +
                '}';
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.limit);
        dest.writeStringList(this.subscribed);
        dest.writeTypedList(others);
    }

    public Category() {
    }

    protected Category(Parcel in) {
        this.limit = in.readString();
        this.subscribed = in.createStringArrayList();
        this.others = in.createTypedArrayList(Theme.CREATOR);
    }

    public static final Parcelable.Creator<Category> CREATOR = new Parcelable.Creator<Category>() {
        public Category createFromParcel(Parcel source) {
            return new Category(source);
        }

        public Category[] newArray(int size) {
            return new Category[size];
        }
    };
}
